Optimal. Leaf size=115 \[ -\frac{2 a^2+b^2}{4 x^2}+a b d \cos (c) \text{CosIntegral}\left (d x^2\right )-a b d \sin (c) \text{Si}\left (d x^2\right )-\frac{a b \sin \left (c+d x^2\right )}{x^2}+\frac{1}{2} b^2 d \sin (2 c) \text{CosIntegral}\left (2 d x^2\right )+\frac{1}{2} b^2 d \cos (2 c) \text{Si}\left (2 d x^2\right )+\frac{b^2 \cos \left (2 \left (c+d x^2\right )\right )}{4 x^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.221334, antiderivative size = 115, normalized size of antiderivative = 1., number of steps used = 13, number of rules used = 8, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.444, Rules used = {3403, 6, 3380, 3297, 3303, 3299, 3302, 3379} \[ -\frac{2 a^2+b^2}{4 x^2}+a b d \cos (c) \text{CosIntegral}\left (d x^2\right )-a b d \sin (c) \text{Si}\left (d x^2\right )-\frac{a b \sin \left (c+d x^2\right )}{x^2}+\frac{1}{2} b^2 d \sin (2 c) \text{CosIntegral}\left (2 d x^2\right )+\frac{1}{2} b^2 d \cos (2 c) \text{Si}\left (2 d x^2\right )+\frac{b^2 \cos \left (2 \left (c+d x^2\right )\right )}{4 x^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3403
Rule 6
Rule 3380
Rule 3297
Rule 3303
Rule 3299
Rule 3302
Rule 3379
Rubi steps
\begin{align*} \int \frac{\left (a+b \sin \left (c+d x^2\right )\right )^2}{x^3} \, dx &=\int \left (\frac{a^2}{x^3}+\frac{b^2}{2 x^3}-\frac{b^2 \cos \left (2 c+2 d x^2\right )}{2 x^3}+\frac{2 a b \sin \left (c+d x^2\right )}{x^3}\right ) \, dx\\ &=\int \left (\frac{a^2+\frac{b^2}{2}}{x^3}-\frac{b^2 \cos \left (2 c+2 d x^2\right )}{2 x^3}+\frac{2 a b \sin \left (c+d x^2\right )}{x^3}\right ) \, dx\\ &=-\frac{2 a^2+b^2}{4 x^2}+(2 a b) \int \frac{\sin \left (c+d x^2\right )}{x^3} \, dx-\frac{1}{2} b^2 \int \frac{\cos \left (2 c+2 d x^2\right )}{x^3} \, dx\\ &=-\frac{2 a^2+b^2}{4 x^2}+(a b) \operatorname{Subst}\left (\int \frac{\sin (c+d x)}{x^2} \, dx,x,x^2\right )-\frac{1}{4} b^2 \operatorname{Subst}\left (\int \frac{\cos (2 c+2 d x)}{x^2} \, dx,x,x^2\right )\\ &=-\frac{2 a^2+b^2}{4 x^2}+\frac{b^2 \cos \left (2 \left (c+d x^2\right )\right )}{4 x^2}-\frac{a b \sin \left (c+d x^2\right )}{x^2}+(a b d) \operatorname{Subst}\left (\int \frac{\cos (c+d x)}{x} \, dx,x,x^2\right )+\frac{1}{2} \left (b^2 d\right ) \operatorname{Subst}\left (\int \frac{\sin (2 c+2 d x)}{x} \, dx,x,x^2\right )\\ &=-\frac{2 a^2+b^2}{4 x^2}+\frac{b^2 \cos \left (2 \left (c+d x^2\right )\right )}{4 x^2}-\frac{a b \sin \left (c+d x^2\right )}{x^2}+(a b d \cos (c)) \operatorname{Subst}\left (\int \frac{\cos (d x)}{x} \, dx,x,x^2\right )+\frac{1}{2} \left (b^2 d \cos (2 c)\right ) \operatorname{Subst}\left (\int \frac{\sin (2 d x)}{x} \, dx,x,x^2\right )-(a b d \sin (c)) \operatorname{Subst}\left (\int \frac{\sin (d x)}{x} \, dx,x,x^2\right )+\frac{1}{2} \left (b^2 d \sin (2 c)\right ) \operatorname{Subst}\left (\int \frac{\cos (2 d x)}{x} \, dx,x,x^2\right )\\ &=-\frac{2 a^2+b^2}{4 x^2}+\frac{b^2 \cos \left (2 \left (c+d x^2\right )\right )}{4 x^2}+a b d \cos (c) \text{Ci}\left (d x^2\right )+\frac{1}{2} b^2 d \text{Ci}\left (2 d x^2\right ) \sin (2 c)-\frac{a b \sin \left (c+d x^2\right )}{x^2}-a b d \sin (c) \text{Si}\left (d x^2\right )+\frac{1}{2} b^2 d \cos (2 c) \text{Si}\left (2 d x^2\right )\\ \end{align*}
Mathematica [A] time = 0.254218, size = 116, normalized size = 1.01 \[ \frac{-2 a^2+4 a b d x^2 \cos (c) \text{CosIntegral}\left (d x^2\right )-4 a b d x^2 \sin (c) \text{Si}\left (d x^2\right )-4 a b \sin \left (c+d x^2\right )+2 b^2 d x^2 \sin (2 c) \text{CosIntegral}\left (2 d x^2\right )+2 b^2 d x^2 \cos (2 c) \text{Si}\left (2 d x^2\right )+b^2 \cos \left (2 \left (c+d x^2\right )\right )-b^2}{4 x^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.247, size = 203, normalized size = 1.8 \begin{align*} -{\frac{{\it csgn} \left ( d{x}^{2} \right ){{\rm e}^{-2\,ic}}\pi \,{b}^{2}d}{4}}+{\frac{{\it Si} \left ( 2\,d{x}^{2} \right ){{\rm e}^{-2\,ic}}{b}^{2}d}{2}}-{\frac{i}{4}}{\it Ei} \left ( 1,-2\,id{x}^{2} \right ){{\rm e}^{-2\,ic}}{b}^{2}d+{\frac{i}{4}}{b}^{2}d{\it Ei} \left ( 1,-2\,id{x}^{2} \right ){{\rm e}^{2\,ic}}-{\frac{abd{\it Ei} \left ( 1,-id{x}^{2} \right ){{\rm e}^{ic}}}{2}}+{\frac{i}{2}}{\it csgn} \left ( d{x}^{2} \right ){{\rm e}^{-ic}}\pi \,abd-i{\it Si} \left ( d{x}^{2} \right ){{\rm e}^{-ic}}abd-{\frac{{\it Ei} \left ( 1,-id{x}^{2} \right ){{\rm e}^{-ic}}abd}{2}}-{\frac{{a}^{2}}{2\,{x}^{2}}}-{\frac{{b}^{2}}{4\,{x}^{2}}}-{\frac{ab\sin \left ( d{x}^{2}+c \right ) }{{x}^{2}}}+{\frac{{b}^{2}\cos \left ( 2\,d{x}^{2}+2\,c \right ) }{4\,{x}^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] time = 1.2421, size = 167, normalized size = 1.45 \begin{align*} \frac{1}{2} \,{\left ({\left (\Gamma \left (-1, i \, d x^{2}\right ) + \Gamma \left (-1, -i \, d x^{2}\right )\right )} \cos \left (c\right ) -{\left (i \, \Gamma \left (-1, i \, d x^{2}\right ) - i \, \Gamma \left (-1, -i \, d x^{2}\right )\right )} \sin \left (c\right )\right )} a b d + \frac{{\left ({\left ({\left (i \, \Gamma \left (-1, 2 i \, d x^{2}\right ) - i \, \Gamma \left (-1, -2 i \, d x^{2}\right )\right )} \cos \left (2 \, c\right ) +{\left (\Gamma \left (-1, 2 i \, d x^{2}\right ) + \Gamma \left (-1, -2 i \, d x^{2}\right )\right )} \sin \left (2 \, c\right )\right )} d x^{2} - 1\right )} b^{2}}{4 \, x^{2}} - \frac{a^{2}}{2 \, x^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.06748, size = 425, normalized size = 3.7 \begin{align*} \frac{2 \, b^{2} d x^{2} \cos \left (2 \, c\right ) \operatorname{Si}\left (2 \, d x^{2}\right ) - 4 \, a b d x^{2} \sin \left (c\right ) \operatorname{Si}\left (d x^{2}\right ) + 2 \, b^{2} \cos \left (d x^{2} + c\right )^{2} - 4 \, a b \sin \left (d x^{2} + c\right ) - 2 \, a^{2} - 2 \, b^{2} + 2 \,{\left (a b d x^{2} \operatorname{Ci}\left (d x^{2}\right ) + a b d x^{2} \operatorname{Ci}\left (-d x^{2}\right )\right )} \cos \left (c\right ) +{\left (b^{2} d x^{2} \operatorname{Ci}\left (2 \, d x^{2}\right ) + b^{2} d x^{2} \operatorname{Ci}\left (-2 \, d x^{2}\right )\right )} \sin \left (2 \, c\right )}{4 \, x^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (a + b \sin{\left (c + d x^{2} \right )}\right )^{2}}{x^{3}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.12347, size = 305, normalized size = 2.65 \begin{align*} \frac{4 \,{\left (d x^{2} + c\right )} a b d^{2} \cos \left (c\right ) \operatorname{Ci}\left (d x^{2}\right ) - 4 \, a b c d^{2} \cos \left (c\right ) \operatorname{Ci}\left (d x^{2}\right ) + 2 \,{\left (d x^{2} + c\right )} b^{2} d^{2} \operatorname{Ci}\left (2 \, d x^{2}\right ) \sin \left (2 \, c\right ) - 2 \, b^{2} c d^{2} \operatorname{Ci}\left (2 \, d x^{2}\right ) \sin \left (2 \, c\right ) - 4 \,{\left (d x^{2} + c\right )} a b d^{2} \sin \left (c\right ) \operatorname{Si}\left (d x^{2}\right ) + 4 \, a b c d^{2} \sin \left (c\right ) \operatorname{Si}\left (d x^{2}\right ) - 2 \,{\left (d x^{2} + c\right )} b^{2} d^{2} \cos \left (2 \, c\right ) \operatorname{Si}\left (-2 \, d x^{2}\right ) + 2 \, b^{2} c d^{2} \cos \left (2 \, c\right ) \operatorname{Si}\left (-2 \, d x^{2}\right ) + b^{2} d^{2} \cos \left (2 \, d x^{2} + 2 \, c\right ) - 4 \, a b d^{2} \sin \left (d x^{2} + c\right ) - 2 \, a^{2} d^{2} - b^{2} d^{2}}{4 \, d^{2} x^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]